// 格式化类型颜色
export const formatTypeColor = (data: any, typeColor: any) => {
     console.log(data, typeColor)
     let allType: any = []
     data.forEach((item: any) => {
          item.datas.forEach((chil: any) => {
               allType.push(chil[typeColor[item.basename]])
          })
     })
     allType = [...new Set(allType)]
     const formatColor = allType
          .map((item: any) => {
               return {
                    type: item,
                    color: randomColor(),
               }
          })
          .filter((item: any) => item.type)
     return formatColor
}
export const randomColor = () => {
     return (
          '#' +
          Math.floor(Math.random() * 0xffffff)
               .toString(16)
               .padEnd(6, '0')
     )
}
